﻿using System;
using Infrastructure.HardCoding;

public partial class Register : System.Web.UI.Page
{
    protected int OrderTypeProp
    {
        get
        {
            int result;
            if (Int32.TryParse(hdnOrderTypeProp.Value, out result))
                return result;
            return -1;
        }
        set { hdnOrderTypeProp.Value = value.ToString(); }
    }


    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["orderType"] != null)
            {
                if (Request.QueryString["orderType"] == ((int)Enums.orderType.order).ToString())
                {
                    OrderTypeProp = (int) Enums.orderType.order;
                    ucRegisterId.PageToRedirect = OrderTypeProp.ToString();
                    
                }
                else if (Request.QueryString["orderType"] == ((int)Enums.orderType.request).ToString())
                {
                    OrderTypeProp = (int) Enums.orderType.request;
                    ucRegisterId.PageToRedirect = OrderTypeProp.ToString();
                }
                else
                {
                    ucRegisterId.PageToRedirect = string.Empty;
                }
            }
            else
                ucRegisterId.PageToRedirect = string.Empty;   
        }
    }
}
